home *** CD-ROM | disk | FTP | other *** search
/ Exame Informatica 137 / Exame Informatica 137.iso / Actualizacoes / CatalystMotherboard / 6-9-igp_xp-2k_dd_ccc_wdm_sb_gart_enu_35774.exe / Data1.cab / _94FC3CF24C7C44DE9AAD20750FAD38E0 < prev    next >
Text File  |  2003-09-15  |  9KB  |  294 lines

  1. // Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
  2. //
  3.  
  4. function  WWHOutlineImagingFast_Object()
  5. {
  6.   this.mIterator    = new WWHOutlineIterator_Object(true);
  7.   this.mImageSrcDir = WWHOutlineImaging_ImageSrcDir();
  8.   this.mEventString = WWHPopup_EventString();
  9.   this.mHTMLSegment = new WWHStringBuffer_Object();
  10.   this.mbUseList    = true;
  11.  
  12.   this.fGetIconURL     = WWHOutlineImaging_GetIconURL;
  13.   this.fGetPopupAction = WWHOutlineImaging_GetPopupAction;
  14.   this.fGetLink        = WWHOutlineImaging_GetLink;
  15.   this.fGetEntryHTML   = WWHOutlineImaging_GetEntryHTML;
  16.  
  17.   this.fGenerateStyles = WWHOutlineImagingFast_GenerateStyles;
  18.   this.fReset          = WWHOutlineImagingFast_Reset;
  19.   this.fAdvance        = WWHOutlineImagingFast_Advance;
  20.   this.fOpenLevel      = WWHOutlineImagingFast_OpenLevel;
  21.   this.fCloseLevel     = WWHOutlineImagingFast_CloseLevel;
  22.   this.fSameLevel      = WWHOutlineImagingFast_SameLevel;
  23.   this.fDisplayEntry   = WWHOutlineImagingFast_DisplayEntry;
  24.   this.fUpdateEntry    = WWHOutlineImagingFast_UpdateEntry;
  25.   this.fRevealEntry    = WWHOutlineImagingFast_RevealEntry;
  26.  
  27.   // Workaround for Windows IE
  28.   //
  29.   if ((WWHFrame.WWHBrowser.mBrowser == 2) &&  // Shorthand for IE
  30.       (WWHFrame.WWHBrowser.mPlatform == 1))   // Shorthand for Windows
  31.   {
  32.     this.mbUseList = false;
  33.   }
  34. }
  35.  
  36. function  WWHOutlineImagingFast_GenerateStyles()
  37. {
  38.   var  StyleBuffer = new WWHStringBuffer_Object();
  39.  
  40.  
  41.   StyleBuffer.fAppend("<style type=\"text/css\">\n");
  42.   StyleBuffer.fAppend(" <!--\n");
  43.   StyleBuffer.fAppend("  a:active\n");
  44.   StyleBuffer.fAppend("  {\n");
  45.   StyleBuffer.fAppend("    text-decoration: none;\n");
  46.   StyleBuffer.fAppend("    background-color: " + WWHFrame.WWHJavaScript.mSettings.mTOC.mHighlightColor + ";\n");
  47.   StyleBuffer.fAppend("    " + WWHFrame.WWHJavaScript.mSettings.mTOC.mFontStyle + ";\n");
  48.   StyleBuffer.fAppend("  }\n");
  49.   StyleBuffer.fAppend("  a:hover\n");
  50.   StyleBuffer.fAppend("  {\n");
  51.   StyleBuffer.fAppend("    text-decoration: underline;\n");
  52.   StyleBuffer.fAppend("    color: " + WWHFrame.WWHJavaScript.mSettings.mTOC.mEnabledColor + ";\n");
  53.   StyleBuffer.fAppend("    " + WWHFrame.WWHJavaScript.mSettings.mTOC.mFontStyle + ";\n");
  54.   StyleBuffer.fAppend("  }\n");
  55.   StyleBuffer.fAppend("  a\n");
  56.   StyleBuffer.fAppend("  {\n");
  57.   StyleBuffer.fAppend("    text-decoration: none;\n");
  58.   StyleBuffer.fAppend("    color: " + WWHFrame.WWHJavaScript.mSettings.mTOC.mEnabledColor + ";\n");
  59.   StyleBuffer.fAppend("    " + WWHFrame.WWHJavaScript.mSettings.mTOC.mFontStyle + ";\n");
  60.   StyleBuffer.fAppend("  }\n");
  61.   StyleBuffer.fAppend("  td\n");
  62.   StyleBuffer.fAppend("  {\n");
  63.   StyleBuffer.fAppend("    margin-top: 0pt;\n");
  64.   StyleBuffer.fAppend("    margin-bottom: 0pt;\n");
  65.   StyleBuffer.fAppend("    margin-left: 0pt;\n");
  66.   StyleBuffer.fAppend("    align: left;\n");
  67.   StyleBuffer.fAppend("    valign: middle;\n");
  68.   StyleBuffer.fAppend("    " + WWHFrame.WWHJavaScript.mSettings.mTOC.mFontStyle + ";\n");
  69.   StyleBuffer.fAppend("  }\n");
  70.   if (this.mbUseList)
  71.   {
  72.     StyleBuffer.fAppend("  ul\n");
  73.     StyleBuffer.fAppend("  {\n");
  74.     StyleBuffer.fAppend("    list-style-type: none;\n");
  75.     StyleBuffer.fAppend("    padding-left: 0pt;\n");
  76.     StyleBuffer.fAppend("    margin-top: 0pt;\n");
  77.     StyleBuffer.fAppend("    margin-bottom: 0pt;\n");
  78.     StyleBuffer.fAppend("    margin-left: 0pt;\n");
  79.     StyleBuffer.fAppend("  }\n");
  80.     StyleBuffer.fAppend("  li\n");
  81.     StyleBuffer.fAppend("  {\n");
  82.     StyleBuffer.fAppend("    margin-top: 0pt;\n");
  83.     StyleBuffer.fAppend("    margin-bottom: 0pt;\n");
  84.     StyleBuffer.fAppend("    margin-left: 0pt;\n");
  85.     StyleBuffer.fAppend("  }\n");
  86.   }
  87.   else
  88.   {
  89.     StyleBuffer.fAppend("  div.list\n");
  90.     StyleBuffer.fAppend("  {\n");
  91.     StyleBuffer.fAppend("    margin-top: 0pt;\n");
  92.     StyleBuffer.fAppend("    margin-bottom: 0pt;\n");
  93.     StyleBuffer.fAppend("    margin-left: 0pt;\n");
  94.     StyleBuffer.fAppend("  }\n");
  95.   }
  96.   StyleBuffer.fAppend(" // -->\n");
  97.   StyleBuffer.fAppend("</style>\n");
  98.  
  99.   return StyleBuffer.fGetBuffer();
  100. }
  101.  
  102. function  WWHOutlineImagingFast_Reset()
  103. {
  104.   this.mIterator.fReset(WWHFrame.WWHOutline.mTopEntry);
  105. }
  106.  
  107. function  WWHOutlineImagingFast_Advance(ParamMaxHTMLSegmentSize)
  108. {
  109.   var  Entry;
  110.  
  111.  
  112.   this.mHTMLSegment.fReset();
  113.   while (((ParamMaxHTMLSegmentSize == -1) ||
  114.           (this.mHTMLSegment.fSize() < ParamMaxHTMLSegmentSize)) &&
  115.          (this.mIterator.fAdvance(this)))
  116.   {
  117.     Entry = this.mIterator.mEntry;
  118.  
  119.     // Process current entry
  120.     //
  121.     if (Entry.mbShow)
  122.     {
  123.       if (this.mbUseList)
  124.       {
  125.         this.mHTMLSegment.fAppend("<li id=i" + Entry.mID + ">");
  126.         this.mHTMLSegment.fAppend(this.fDisplayEntry(Entry));
  127.       }
  128.       else
  129.       {
  130.         if (Entry.mChildren != null)
  131.         {
  132.           this.mHTMLSegment.fAppend("<div class=\"list\" id=l" + Entry.mID + ">\n");
  133.           this.mHTMLSegment.fAppend(this.fDisplayEntry(Entry));
  134.           if ( ! Entry.mbExpanded)
  135.           {
  136.             this.mHTMLSegment.fAppend("</div>\n");
  137.           }
  138.         }
  139.         else
  140.         {
  141.           this.mHTMLSegment.fAppend(this.fDisplayEntry(Entry));
  142.         }
  143.       }
  144.     }
  145.   }
  146.  
  147.   return (this.mHTMLSegment.fSize() > 0);  // Return true if segment created
  148. }
  149.  
  150. function  WWHOutlineImagingFast_OpenLevel()
  151. {
  152.   if (this.mbUseList)
  153.   {
  154.     this.mHTMLSegment.fAppend("<ul>\n");
  155.   }
  156. }
  157.  
  158. function  WWHOutlineImagingFast_CloseLevel(bParamScopeComplete)
  159. {
  160.   if (this.mbUseList)
  161.   {
  162.     this.mHTMLSegment.fAppend("</li>\n");
  163.     this.mHTMLSegment.fAppend("</ul>\n");
  164.     if ( ! bParamScopeComplete)
  165.     {
  166.       this.mHTMLSegment.fAppend("</li>\n");
  167.     }
  168.   }
  169.   else
  170.   {
  171.     if ( ! bParamScopeComplete)
  172.     {
  173.       this.mHTMLSegment.fAppend("</div>\n");
  174.     }
  175.   }
  176. }
  177.  
  178. function  WWHOutlineImagingFast_SameLevel()
  179. {
  180.   if (this.mbUseList)
  181.   {
  182.     this.mHTMLSegment.fAppend("</li>\n");
  183.   }
  184. }
  185.  
  186. function  WWHOutlineImagingFast_DisplayEntry(ParamEntry)
  187. {
  188.   var  VarEntryHTML = "";
  189.  
  190.  
  191.   if (this.mbUseList)
  192.   {
  193.     VarEntryHTML += this.fGetEntryHTML(ParamEntry) + "\n";
  194.   }
  195.   else
  196.   {
  197.     VarEntryHTML += "<div id=i" + ParamEntry.mID + ">" + this.fGetEntryHTML(ParamEntry) + "</div>\n";
  198.   }
  199.  
  200.   return VarEntryHTML;
  201. }
  202.  
  203. function  WWHOutlineImagingFast_UpdateEntry(ParamEntry)
  204. {
  205.   var  EntryHTML = "";
  206.   var  ElementID;
  207.   var  VarPanelViewFrame;
  208.  
  209.  
  210.   // Get entry display
  211.   //
  212.   EntryHTML = this.fDisplayEntry(ParamEntry);
  213.  
  214.   // Reset iterator to process current entry's children
  215.   //
  216.   this.mIterator.fReset(ParamEntry);
  217.  
  218.   // Process display of children
  219.   //
  220.   if (this.fAdvance(-1))
  221.   {
  222.     // Result already stored in this.mHTMLSegment
  223.     //
  224.   }
  225.  
  226.   // Close down any popups we had going to prevent JavaScript errors
  227.   //
  228.   WWHFrame.WWHJavaScript.mPanels.mPopup.fHide();
  229.  
  230.   // Update HTML
  231.   //
  232.   VarPanelViewFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHPanelViewFrame"));
  233.   if (this.mbUseList)
  234.   {
  235.     ElementID = "i" + ParamEntry.mID;
  236.   }
  237.   else
  238.   {
  239.     ElementID = "l" + ParamEntry.mID;
  240.   }
  241.   if ((WWHFrame.WWHBrowser.mBrowser == 2) ||  // Shorthand for IE
  242.       (WWHFrame.WWHBrowser.mBrowser == 3))    // Shorthand for iCab
  243.   {
  244.     VarPanelViewFrame.document.all[ElementID].innerHTML = EntryHTML + this.mHTMLSegment.fGetBuffer();
  245.   }
  246.   else if ((WWHFrame.WWHBrowser.mBrowser == 4) ||  // Shorthand for Netscape 6.0
  247.            (WWHFrame.WWHBrowser.mBrowser == 5))    // Shorthand for Safari
  248.   {
  249.     VarPanelViewFrame.document.getElementById(ElementID).innerHTML = EntryHTML + this.mHTMLSegment.fGetBuffer();
  250.   }
  251. }
  252.  
  253. function  WWHOutlineImagingFast_RevealEntry(ParamEntry,
  254.                                             bParamVisible)
  255. {
  256.   var  ParentEntry;
  257.   var  LastClosedParentEntry = null;
  258.  
  259.  
  260.   // Expand out enclosing entries
  261.   //
  262.   ParentEntry = ParamEntry.mParent;
  263.   while (ParentEntry != null)
  264.   {
  265.     if ( ! ParentEntry.mbExpanded)
  266.     {
  267.       ParentEntry.mbExpanded = true;
  268.       LastClosedParentEntry = ParentEntry;
  269.     }
  270.  
  271.     ParentEntry = ParentEntry.mParent;
  272.   }
  273.  
  274.   // Set target entry
  275.   //
  276.   WWHFrame.WWHOutline.mPanelAnchor = "t" + ParamEntry.mID;
  277.  
  278.   // Update display
  279.   //
  280.   if (bParamVisible)
  281.   {
  282.     // Expand parent entry to reveal target entry
  283.     //
  284.     if (LastClosedParentEntry != null)
  285.     {
  286.       this.fUpdateEntry(LastClosedParentEntry);
  287.     }
  288.  
  289.     // Display target
  290.     //
  291.     WWHFrame.WWHJavaScript.mPanels.fJumpToAnchor();
  292.   }
  293. }
  294.